/*============================================================
 Create Time:			2020-09-04 17:37:51
 Last modify:			2020-09-08 00:31:43
 Writer:				Wenhao	1795902848@qq.com
 File Name:				code.c
 File Type:				C Source File
 Tool:					Windows -- vim & gcc, gdb
 Information:			
============================================================*/

#include <reg52.h>
#include <intrins.h>
#include "code.h"
#include "lib.h"
#include "C:\\my_lib\my_lib.h"

/*------------------------------------------------
  Send one byte to uart. P3.0
------------------------------------------------*/
void send_byte(uint8 dat)
{
	SBUF = dat;
	while(!TI);
	TI = 0;
}

void send_user_data(uint8 my_data)
{
	send_byte((uint8)(0xa1));
	send_byte((uint8)(0xf1));
	send_byte((uint8)(0x01));
	send_byte((uint8)(0x02));
	send_byte(my_data);
	delay(200);
}
